<template>
  <div id="setting">
    <div style="margin-top: 0.2rem">
      <group>
        <cell title="修改登录密码" is-link link="findPwd"></cell>
        <cell title="修改交易密码" is-link link="setPayPwd?type=change"></cell>
      </group>
    </div>
    <div style="margin-top: 0.2rem">
      <group>
        <cell title="黑名单" is-link link="blacklist"></cell>
      </group>
    </div>
    <div style="margin-top: 0.2rem">
      <group>
        <cell title="版本信息" :value="version"></cell>
      </group>
    </div>
    <div style="margin: 0.3rem 0.2rem;">
      <x-button type="primary" :show-loading="loading" action-type="button" @click.native="handleLogout">{{isWechat}}</x-button>
    </div>
  </div>
</template>
<script>
import {Cell} from 'vux'
import PubHeader from '../components/PubHeader.vue'
export default{
  name: 'setting',
  computed: {
    isWechat() {
      const ua = navigator.userAgent.toLowerCase();
      return ua.match(/MicroMessenger/i) == "micromessenger"? '清除缓存': '退出登录'
    }
  },
  components: {
    PubHeader,
    Cell
  },
  data() {
    return {
      version: $config.version,
      loading: false
    }
  },
  methods: {
    handleLogout() {
      this.$router.push({path: '/logout'})
    }
  }
}
</script>
